package model;

import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Point;

import javax.swing.ImageIcon;

import view.PlayerRep;
import view.SquareRep;

public class Player implements ModelUpdate{

	public int x;
	public int y;
	
	public Player(int x, int y){
		this.x = x;
		this.y = y;
	}
	public void move(int dx, int dy){
		this.x += dx;
		this.y += dy;
	}
	public Point[] getCorners(){
		return new Point[]{new Point(x, y), new Point(x+PlayerRep.WIDTH, y), new Point(x,y+PlayerRep.HEIGHT), new Point(x+PlayerRep.WIDTH,y+PlayerRep.HEIGHT)};
	}
	
	public void update() {
	}
	public ImageIcon getIcon() {
		return new ImageIcon(){
			public void paintIcon(Component c, Graphics g, int x, int y){
				g.setColor(Color.GREEN);
				g.fillOval(x, y, PlayerRep.WIDTH, PlayerRep.HEIGHT);
			}
		};
	}
}
